import request from '@/utils/request'
// menu-子节点获取 role-子节点获取
export function getMenusTree(pid) {
  return request({
    url: 'menu/lazy?pid=' + pid,
    method: 'get'
  })
}
// menu-上级菜单获取
export function getMenuSuperior(id) {
  return request({
    url: 'menu/superior?id=' + id,
    method: 'get'
  })
}
// role-子节点获取
export function getChild(id) {
  return request({
    url: 'menu/lazy?id=' + id,
    method: 'get'
  })
}
// menu-增
export function create(data) {
  return request({
    url: 'menu',
    method: 'post',
    data
  })
}
// menu-删
export function del(ids) {
  return request({
    url: 'menu',
    method: 'delete',
    data: ids
  })
}
// menu-改
export function update(data) {
  return request({
    url: 'menu',
    method: 'put',
    data
  })
}
export default { create, update, del, getChild, getMenuSuperior, getMenusTree }
// export default { add, edit, del, getMenusTree, getMenuSuperior, getMenus, getChild }
